package candidate_43148;

import java.util.Scanner;



public class CandidateB_43148 extends Candidate_43148 implements Rank {
	private double literature, history, geography;
	public CandidateB_43148(){
		literature=0;
		history=0;
		geography=0;
	}
	public CandidateB_43148(double literature,double history,double geography){
		this.literature=literature;
		this.history=history;
		this.geography=geography;
	}
	public void input() {
		super.input();
		Scanner kb = new Scanner(System.in);
		System.out.print("Enter literature :");
		literature = kb.nextDouble();
		System.out.print("Enter history :");
		history = kb.nextDouble();
		System.out.print("Enter geography :");
		geography = kb.nextDouble();
		System.out.println();
	}

	public double average() {
		return (literature + history + geography) / 3;
	}

	public String Rank() {
		if (average() >= 8 && average() <= 10)
			return "Good";
		else if (average() >= 7 && average() < 8)
			return "Fairly Good";
		else if (average() >= 5 && average() < 7)
			return "Average";
		else
			return "Fail";
	}

	public String toString() {
		return super.toString() + "Literature :" + literature + "\n"
				+ "history :" + history + "\n" + "Geography :" + geography
				+ "\n" + "Rank :" + Rank() + "\nAverage:" + average();
	}

	public static void main(String args[]) {
		CandidateB_43148 h = new CandidateB_43148();
		h.input();
		System.out.print(h.toString());
	}

}
